package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.PaperQueAnswerMapper;
import com.education.wisdom.pojo.PaperQueAnswer;
import com.education.wisdom.service.IPaperQueAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 问题答案 服务层实现
 * 
 * @author ruoyi
 * @date 2018-12-21
 */
@Service
public class PaperQueAnswerServiceImpl implements IPaperQueAnswerService
{
	@Autowired
	private PaperQueAnswerMapper paperQueAnswerMapper;

	/**
     * 查询问题答案信息
     * 
     * @param paperId 试卷Id
     * @return 问题答案信息
     */
    @Override
	public List<PaperQueAnswer> selectPaperQueAnswerById(Integer paperId)
	{
	    return paperQueAnswerMapper.selectPaperQueAnswerById(paperId);
	}

	/**
	 * 查询问题答案信息
	 * @param map
	 * @return
	 */
	@Override
	public List<PaperQueAnswer> selectAnswerByStu(Map<String, Object> map) {
		return paperQueAnswerMapper.selectAnswerByStu(map);
	}

	/**
     * 查询问题答案列表
     * 
     * @param paperQueAnswer 问题答案信息
     * @return 问题答案集合
     */
	@Override
	public List<PaperQueAnswer> selectPaperQueAnswerList(PaperQueAnswer paperQueAnswer)
	{
	    return paperQueAnswerMapper.selectPaperQueAnswerList(paperQueAnswer);
	}
	
    /**
     * 新增问题答案
     * 
     * @param paperQueAnswer 问题答案信息
     * @return 结果
     */
	@Override
	public int insertPaperQueAnswer(PaperQueAnswer paperQueAnswer)
	{
	    return paperQueAnswerMapper.insertPaperQueAnswer(paperQueAnswer);
	}
	
	/**
     * 修改问题答案
     * 
     * @param paperQueAnswer 问题答案信息
     * @return 结果
     */
	@Override
	public int updatePaperQueAnswer(PaperQueAnswer paperQueAnswer)
	{
	    return paperQueAnswerMapper.updatePaperQueAnswer(paperQueAnswer);
	}

	/**
     * 删除问题答案对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deletePaperQueAnswerByIds(String ids)
	{
		return paperQueAnswerMapper.deletePaperQueAnswerByIds(Convert.toStrArray(ids));
	}

	@Override
	public int sumPaperQueAnswer(PaperQueAnswer paperQueAnswer) {
		return paperQueAnswerMapper.sumPaperQueAnswer(paperQueAnswer);
	}

}
